<script type="text/javascript" src="../wp-content/plugins/stSocialMediaToolbox/Toolboxes/stContestToolbox/scripts/backend/jquery-ui-1.8.7.custom.min.js"></script>
<script type="text/javascript" >
    jQuery(document).ready(function() {
        jQuery(".galleryVideo a[rel^='prettyPhoto']").prettyPhoto({
            theme:'facebook',
            keyboard_shortcuts: false
        });
        stContestToolbox.sortColumn();
        stContestToolbox.shortAction();   
        stContestToolbox.pagingCallbackFunction = function(data){
            data['id'] = <?php echo $data_id;?>;            
        };

        stContestToolbox.sortCallbackFunction = function(data){
            data['id'] = <?php echo $data_id;?>;           
        }
    });
</script>
<style type="text/css">
    .column-data_id{
        width:50px;
    }
</style>
<?php 

function contest_format_date($input) {
    $d = substr($input, 0, 16);    
    $d = str_replace("-",".", $d);
    
    $darrs = explode(" ", $d);
    $date = $darrs[0];
    $time = $darrs[1];
    $dateArrs = explode(".", $date);
    $dateStr = $dateArrs[2] . "." . $dateArrs[1] . "." . $dateArrs[0];
    return $dateStr . " " . $time;
}

function st_contest_format_age($age) {        
    if($age > 100) {
        return "_";
    } else {
        return $age;
    }
}


?>
<div class="w100p bgl">
    <div class="w100p bgr">
        <div class="inner_container">    
            <!-- <br />
             <div class="filter">                      
                <a target="_blank" href="../contest/contest_detail_export.php?format=pdf&contest_id=<?php echo $contest_id;?>&smt_user_id=<?php echo $smt_user_id;?>">
                    <img style="cursor:pointer;margin-bottom: -8px;width: 24px; border-width: 0px;" src="../wp-content/plugins/stSocialMediaToolbox/Toolboxes/stFacebookToolbox/images/pdf.png">
                </a>                
            </div>
            <br /> -->
            <br />
            <table class="widefat galleryVideo" cellspacing="0">
                <thead>
                    <tr>
                        <?php print_column_headers('stcontest_st_uservote'); ?>
                    </tr>
                </thead>
                <tbody>
                    <!-- . "<span class='trash' short_action='delete' id='$result->data_id'>Trash </span>"  -->
                    <?php
                        if (count($results) > 0) {                            
                            
                            foreach ($results as $result) {  
                               echo "<tr id='$result->user_like_id' $tr_class>"   
                                . "<td>{$result->user_like_id}  </td>"   
                                . "<td ><div class='pos_rel'><a target='_blank' href='http://www.facebook.com/profile.php?id={$result->facebook_user_id}'>" . stContestToolboxFunctions::limitWords($result->name, 5) . "</a>"
                                . "<div class=\"row-actions short_action\">"                                                                                                                                                       
                                . "<a target='_blank' href='http://www.facebook.com/profile.php?id={$result->facebook_user_id}'>Facebook</a>"                              
                                . "</div></div>"
                                . "</td>"
                                . "<td>" . st_contest_format_age($result->age) . "</td>"
                                . "<td>" . contest_format_date($result->liked_time) . "</td>"                                
                                ;                                                                 
                                echo "</tr>"
                                ;
                            }
                        }
                    ?>                   
                    </tbody>
                </table>
                <div class="page_d">
                <?php echo $pagination ?>
                <div class="cl"></div>
            </div>

        </div>
    </div>
</div>